<?php if(is_null($this->users) or empty($this->users)) { ?>
	
	<div id="content_manage" class="error">Aucun utilisateur dans la base de données</div>
	
	<?php
	return;
}
?>

<div id="content_manage">
	
	<table id="users_list">
		
		<tr>
			<th><input type="checkbox" id="select_all" name="select_all" value="1" /></th>
			<th>Prénom</th>
			<th>Nom</th>
			<th>Email</th>
			<th>Téléphone</th>
			<th>Ville</th>
			<th>Editer</th>
			<th>Etat</th>
		</tr>
		
		<?php foreach($this->users as $u) { ?>
		<tr>
			<td><input type="checkbox" id="" class="select_user" name="user[]" value="1" /></td>
			<td><?php echo $u['firstname']; ?></td>
			<td><?php echo $u['lastname']; ?></td>
			<td><?php echo $u['email']; ?></td>
			<td><?php echo $u['telephone']; ?></td>
			<td><?php echo $u['city']; ?></td>
			<td class="center">
				<a href="<?php echo $this->url(array('module' => 'backend', 'controller' => 'user', 'action' => 'set', 'id' => $u['id']), null, true); ?>">
					<img src="<?php echo $this->baseUrl(); ?>/images/icons/edit.png" alt="Modifier" />
				</a>
			</td>
			<td class="center">
				<?php if($u['status'] == 'active') { ?>
					<a href="<?php echo $this->url(array('module' => 'backend', 'controller' => 'user', 'action' => 'inactivate', 'id' => $u['id']), null, true); ?>" class="switch_status">
						<img src="<?php echo $this->baseUrl(); ?>/images/icons/active.png" alt="Désactiver" />
					</a>
				<?php } else { ?>
					<a href="<?php echo $this->url(array('module' => 'backend', 'controller' => 'user', 'action' => 'activate', 'id' => $u['id']), null, true); ?>" class="switch_status">
						<img src="<?php echo $this->baseUrl(); ?>/images/icons/inactive.png" alt="Activer" />
					</a>
				<?php } ?>
			</td>
		</tr>
		<?php } ?>
		
	</table>
	<br />
	
	Pour la sélection :
	<ul>
		<li>
			<?php /* <img src="<?php echo $this->baseUrl(); ?>/images/icons/" alt="" title="Modifier" /> */ ?>
			<a href="<?php echo $this->url(array('module' => 'backend', 'controller' => 'user', 'action' => 'activate', 'id' => 'all'), null, true); ?>">Activer</a>
		</li>
		<li>
			<?php /* <img src="<?php echo $this->baseUrl(); ?>/images/icons/" alt="" title="Modifier" /> */ ?>
			<a href="<?php echo $this->url(array('module' => 'backend', 'controller' => 'user', 'action' => 'unactivate', 'id' => 'all'), null, true); ?>">Désactiver</a>
		</li>
		<li>
			<?php /* <img src="<?php echo $this->baseUrl(); ?>/images/icons/" alt="" title="Modifier" /> */ ?>
			<a href="<?php echo $this->url(array('module' => 'backend', 'controller' => 'user', 'action' => 'delete', 'id' => 'all'), null, true); ?>">Supprimer</a>
		</li>
	</ul>
	
</div>
